<?=$this->load->view('include_header',null)?>
<style type="text/css">
form#form textarea {
    height: 50px;
    overflow: auto;
    padding: 5px;
    width: 410px;
}
</style>
	<div id="top-panel">
		<div id="panel">
			<ul>
				<li class="current"><a href="<?=site_url('archive/idcard/'.$id)?>" class="report"><?=(empty($id))?"录入新":"编辑"?>客户基本信息</a></li>
				<?php if(!empty($info->id)):?><li><a id="printInfo" class="folder_table">打印本页信息</a></li><?php endif;?>
			</ul>
		</div>
	</div>
	<div id="wrapper">
		<div id="content">
			<div id="box">
<!-- table begin -->
<form method="post" id="form"  enctype="multipart/form-data" action="<?=site_url('schengen/zw_update/'.$cateid)?>">

	<h3>津巴布韦申请表</h3>
    <table width="100%">
    <thead>
        <tr>
          <td colspan="4" align="right"><img src="<?= (@$info->avatar)?@$info->avatar:'images/avatar.gif'?>" width="150" height="150" /></td>
		  <td align="right">
		  上传照片<br />
		  <input type="file" name="userphoto" /><br />
		  (.gif|.jpg|.png文件,最大1M)<br />
		  <?php if (@$info->attachment):?><a href="<?= @$info->attachment?>" target="_blank">点击下载附件</a><?php endif; ?>
		  &nbsp;&nbsp;&nbsp;&nbsp;上传附件<br />
		  <input type="file" name="userfile" /><br />
		  (.pdf|.zip|.rar|.doc,最大2M)		  </td>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <td colspan="5" align="right">			
			<input type="hidden" name="id" value="<?=$id?>" />
			<input id="button1" type="submit" value="提交信息" />
			<input id="button2" type="reset" value="重置" />			</td>
        </tr>
    </tfoot>

    <tbody>
        <tr class="odd">
            <td colspan="5" align="center"><strong>To be filled in English (in block capitals) by each adult requiring a visa</strong></td>
        </tr>
        <tr class="even">
            <td>Surname (Mr./Mrs./Miss)</td>
            <td><input type="text" name="surname" value="<?= @$info->surname?>" /></td>
            <td>&nbsp;</td>
            <td>Sex</td>
            <td><input type="radio" name="sex" value="Male" <?= (@$info->sex=='Male')?'checked':''?> />
              Male  
                <input type="radio" name="sex" value="Female" <?= (@$info->sex=='Female')?'checked':''?> />
              Female </td>
        </tr>
        <tr class="odd">
            <td>First Names</td>
            <td><input type="text" name="firstname" value="<?= @$info->firstname?>" /></td>
            <td>&nbsp;</td>
            <td>Date of birth</td>
            <td><input type="text" name="birth" value="<?= @$info->birth?>" id="birth" /></td>
        </tr>
        <tr class="even">
            <td>Place of birth</td>
            <td><input type="text" name="birth_place" value="<?= @$info->birth_place?>" /></td>
            <td>&nbsp;</td>
            <td>Present Nationality</td>
            <td><input type="text" name="cur_nationality" value="<?= @$info->cur_nationality?>" /></td>
        </tr>
        <tr class="odd">
            <td>Previous</td>
            <td><input type="text" name="ori_nationality" value="<?= @$info->ori_nationality?>" /></td>
			<td>&nbsp;</td>
			<td>Passport number</td>
			<td><input type="text" name="travel_document_num" value="<?= @$info->travel_document_num?>" /></td>
        </tr>
        <tr class="even">
          <td>Place of issue</td>
            <td><input type="text" name="travel_document_issue_by" value="<?= @$info->travel_document_issue_by?>" /></td>
            <td>&nbsp;</td>
            <td>Date of issue</td>
            <td><input type="text" name="travel_document_issue_date" value="<?= @$info->travel_document_issue_date?>" id="travel_document_issue_date" /></td>
        </tr>
        <tr class="odd">
             <td>Date of expiry</td>
            <td><input type="text" name="travel_document_valid_date" value="<?= @$info->travel_document_valid_date?>" id="travel_document_valid_date" /></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr class="even">
             <td>Particulars of wife/husband (who must complete<br /> 
              a separate application if traveling)</td>
            <td colspan="4">( a ) Surname 
              <input type="text" name="spouse_surname" value="<?= @$info->spouse_surname?>" />
              <br />
              ( b ) First names 
              <input type="text" name="spouse_firstname" value="<?= @$info->spouse_firstname?>" />
              <br />
              ( c ) Date of birth 
              <input type="text" name="spouse_birth" value="<?= @$info->spouse_birth?>" id="spouse_birth" />  
              &nbsp;&nbsp;Place of birth 
              <input type="text" name="spouse_birth_place" value="<?= @$info->spouse_birth_place?>" /></td>
        </tr>
        <tr class="odd">
            <td colspan="5">Particulars of children under 18 who will accompany applicant.<br />
              Full names   
                <input type="text" name="child1_name" value="<?= @$info->child1_name?>" />
              Place of birth   
              <input type="text" name="child1_birth_place" value="<?= @$info->child1_birth_place?>" />
              Date of birth   
              <input type="text" name="child1_birth" value="<?= @$info->child1_birth?>" id="child1_birth" />
              Passport no.
              <input type="text" name="child1_pass" value="<?= @$info->child1_pass?>" />
              <br />
              Full names
              <input type="text" name="child2_name" value="<?= @$info->child2_name?>" />
			Place of birth
			<input type="text" name="child2_birth_place" value="<?= @$info->child2_birth_place?>" />
			Date of birth
			<input type="text" name="child2_birth" value="<?= @$info->child2_birth?>" id="child2_birth" />
			Passport no.
			<input type="text" name="child2_pass" value="<?= @$info->child2_pass?>" />
			<br />
			Full names
			<input type="text" name="child3_name" value="<?= @$info->child3_name?>" />
			Place of birth
			<input type="text" name="child3_birth_place" value="<?= @$info->child3_birth_place?>" />
			Date of birth
			<input type="text" name="child3_birth" value="<?= @$info->child3_birth?>" id="child3_birth" />
			Passport no.
			<input type="text" name="child3_pass" value="<?= @$info->child3_pass?>" /></td>
        </tr>
        <tr class="even">
            <td>Applicant's present occupation</td>
            <td><input type="text" name="occupation" value="<?= @$info->occupation?>" /></td>
            <td>&nbsp;</td>
            <td>Purpose of visit</td>
            <td><input type="text" name="purpose" value="<?= @$info->purpose?>"/></td>
        </tr>		
        <tr class="odd">
            <td>Normal residential address</td>
            <td colspan="4"><input name="address" type="text" value="<?= @$info->address?>" style="width:300px" /></td>
        </tr>
        <tr class="even">
            <td colspan="5">Proposed address in Zimbabwe (include name of person or business to be visited if applicable)<br />
              <label>
              <textarea name="proposed_address"><?= @$info->proposed_address?></textarea>
              Telephone
              <input type="text" name="proposed_tel" value="<?= @$info->proposed_tel?>" />
              </label></td>
        </tr>
        <tr class="odd">
            <td>Period of visit intended:</td>
            <td colspan="4">From <input type="text" name="visit_from" value="<?= @$info->visit_from?>" id="visit_from" /> 
              To  <input type="text" name="visit_to" value="<?= @$info->visit_to?>" id="visit_to" /></td>
        </tr>
        <tr class="even">
            <td colspan="5">Please complete but do ot detach</td>
        </tr>

        <tr class="odd">
            <td colspan="5"><strong>APPLICANT'S DETAILS</strong></td>
        </tr>
        <tr class="even">
            <td>Surname</td>
            <td><input type="text" name="applicant_surname" value="<?= @$info->applicant_surname?>" /></td>
            <td>&nbsp;</td>
            <td>First names</td>
            <td><input type="text" name="applicant_firstname" value="<?= @$info->applicant_firstname?>" /></td>
        </tr>
        <tr class="odd">
            <td>Date and place of birth</td>
            <td><input type="text" name="applicant_birth" value="<?= @$info->applicant_birth?>" /></td>
			<td>&nbsp;</td>
			<td></td>
			<td></td>
        </tr>
        <tr class="even">
            <td>Accompanying children under 18.</td>
            <td colspan="4">Names 
              <input type="text" name="applicant_child1_name" value="<?= @$info->applicant_child1_name?>" />
              &nbsp;&nbsp;Date of birth
              <input type="text" name="applicant_child1_birth" value="<?= @$info->applicant_child1_birth?>" />
              <br />
              Names
              <input type="text" name="applicant_child2_name" value="<?= @$info->applicant_child2_name?>" />
			&nbsp;&nbsp;Date of birth
			<input type="text" name="applicant_child2_birth" value="<?= @$info->applicant_child2_birth?>" />
			<br />
			Names
			<input type="text" name="applicant_child3_name" value="<?= @$info->applicant_child3_name?>" />
			&nbsp;&nbsp;Date of birth
			<input type="text" name="applicant_child3_birth" value="<?= @$info->applicant_child3_birth?>" /></td>
        </tr>
        <tr class="odd">
            <td colspan="5"><strong>VISA APPLICATION (continued)</strong></td>
        </tr>
        <tr class="even">
            <td>Intended place of entry into Zimbabwe</td>
            <td colspan="4"><input name="intended_place" type="text" value="<?= @$info->intended_place?>" style="width:300px" /></td>
        </tr>
        <tr class="odd">
            <td>Dates of previous entry into Zimbabwe</td>
			<td colspan="4"><input name="pre_entry_date" type="text" value="<?= @$info->pre_entry_date?>" style="width:300px" /></td>
        </tr>
        <tr class="even">
           <td>Address to which visa should be sent</td>
			<td colspan="4"><input name="send_address" type="text" value="<?= @$info->send_address?>" style="width:300px" /></td>
        </tr>
        <tr class="odd">
            <td>Any criminal convictions sustained by applicant <br />
              are to be detailed below. (Minor infringements<br /> 
              of by-laws may be ignored</td>
			<td colspan="4"><textarea name="criminal"><?= @$info->criminal?></textarea></td>
        </tr>
        <tr class="even">
            <td colspan="5">Note.---All visitors to Zimbabwe must be in possession of return tickets (or funds in lieu) and sufficient funds to support
themselves. The granting of a visa is not a guarantee of entry, and holders are also required to comply with the
requirements of the Immigration Act, 1979.</td>
        </tr>
		<tr class="odd">
		<td colspan="5">DO NOT FORGET to complete the address box below--your visa will be sent to this address.</td>
		</tr>
		<tr class="even">
		<td>Name</td>
		<td colspan="4"><input name="post_name" type="text" value="<?= @$info->post_name?>" style="width:500px" /></td>
		</tr>
		<tr class="odd">
		<td>Address</td>
		<td colspan="4"><input name="post_address" type="text" value="<?= @$info->post_address?>" style="width:500px" /></td>
		</tr>
		<tr class="even">
		<td>&nbsp;</td>
		<td></td>
		<td></td>
		<td></td>
		<td></td>
		</tr>
    </tbody>
	</table>
<!-- table end -->
</form>

			</div>
		</div>
		
		<?=$this->load->view('include_sidebar',array('id'=>$id,'forms'=>$forms))?>
	</div>

<script type="text/javascript">
$().ready(function() {
  $("#form").validate({
    rules: {
		surname:"required",
		firstname:"required",
		travel_document_num:"required",
		travel_document_issue_by:"required",
		travel_document_valid_date:"required",
		travel_document_issue_date:"required",
		sex:"required",
		cur_nationality:"required",
		purpose:"required"
    }
  });
  
	$.datepicker.setDefaults(
		{
		dateFormat: 'dd/mm/yy',
		changeMonth: true,
		changeYear: true,
		showOn: "both",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
		}
	);

	$("#travel_document_issue_date").datepicker();
	$("#travel_document_valid_date").datepicker();
	$("#birth").datepicker();
	$("#spouse_birth").datepicker();
	$("#child1_birth").datepicker();
	$("#child2_birth").datepicker();
	$("#child3_birth").datepicker();
	$("#visit_from").datepicker();
	$("#visit_to").datepicker();
	

	$("#printInfo").click(function(o) {
		var prints = [
			{rel_id: <?=$cateid?>, rec_id: <?=$id?>}
		]  ;
		
		var jdata = JSON.stringify(prints);
		//alert(jdata);
		$.post("<?=site_url('proxy/does/'.str_replace('==','',base64_encode('http://'.$_SERVER['SERVER_NAME'].':9090/javaprduct/servlet/test')))?>",{clients:jdata},function(msg){alert(msg)});
	});
	
	$("#printInfo").ajaxError(function(event,request, settings){
		//$(this).append("<li>出错页面:" + settings.url + "</li>");
		alert("无法访问"+ settings.url );
	}); 
 
});
</script>

<?=$this->load->view('include_footer',null)?>